<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="https://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="../../jquery-easyui-1.9.15/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../../js/time.js"></script>
<link rel="stylesheet" type="text/css" href="../../jquery-easyui-1.9.15/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../../jquery-easyui-1.9.15/themes/icon.css">
<link rel="stylesheet" type="text/css" href="../../jquery-easyui-1.9.15/demo/demo.css">
<script>

    function doSearch(){
        $('#tt').datagrid('load',{
            topic: $('#topic').val()
        });
    }

    function doRetry() {
       var checkedDatas=  $('#tt').datagrid('getChecked');
       if(!checkedDatas || checkedDatas.length==0){
           $.messager.alert('提示框','请先选中数据','error');
           return;
       }
        $.ajax({
            type:"POST",
            url:"/redisDelay/admin/deadMessageRetry",
            data:{
                deadJobs:JSON.stringify(checkedDatas)
            },
            success:function(data){
                if(data){
                    $.messager.alert('提示框','操作成功','info');
                }
            }
        });

    }
</script>

<body>

<!-- 列表 -->
<table id="tt" title="死信队列" class="easyui-datagrid" style="width:100%;height:500px"
       url="/redisDelay/admin/deadList"
       iconCls="icon-save" pagination="true" toolbar="#tb">
    <thead>
    <tr>
        <th field="ck" checkbox="true"></th>
        <th field="jobId" width="200">job Id</th>
        <th field="topic" width="80">主题</th>
        <th field="body" width="500" align="right">内容</th>
        <th field="delayTime" width="120" >延迟时间（毫秒）</th>
        <th field="retries" width="70" align="right">重试次数</th>
        <th field="createTime" width="180" align="center" formatter="jsonTimeStamp">创建时间</th>
    </tr>
    </thead>
</table>
<div id="tb" style="padding:3px">
    <span>主题:</span>
    <input id="topic" placeholder="输入topic" style="line-height:26px;border:1px solid #ccc">
    <a href="#" class="easyui-linkbutton" plain="true" onclick="doSearch()">搜索</a>
    <a href="#" class="easyui-linkbutton retry-button" plain="true" onclick="doRetry()">重试</a>
</div>

</body>
</html>